package com.sz.common.base.dao.schema;

import org.apache.ibatis.type.JdbcType;

/**
 * Package: com.sz.common.base.dao.schema <br>
 * Function: TODO: ADD FUNCTION <br>
 * Author: Charles. <br>
 * Date: 2017-02-21 14:26:00.
 */
public class FieldSchema {
    private String fieldName;
    private JdbcType jdbcType;

    public FieldSchema(String name) {
        this(name, JdbcType.VARCHAR);
    }

    public FieldSchema(String name, JdbcType type) {
        this.fieldName = name;
        this.jdbcType = type;
    }

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public JdbcType getJdbcType() {
        return jdbcType;
    }

    public void setJdbcType(JdbcType dataType) {
        this.jdbcType = dataType;
    }

    public String getDataTypeString() {
        if (this.jdbcType != null) {
            return this.jdbcType.toString();
        }
        return null;
    }
}
